<% layout('/layouts/default.html', {title: '生成代码', libs: ['dataGrid']}){ %>
<div class="card bd-0">
    <div class="card-header d-flex align-items-start justify-content-between box-header">
      <div class="pt-1">生成代码</div>
      <div class="d-flex">
          <button type="button" id="btnSearch" title="查询" class="btn btn-xs btn-default"><i  class="fa fa-filter"></i>查询</button>
          <button type="button" href="${ctx}/genTable/form" class="btn btn-xs btn-primary mg-l-10 btnTool" title="新增生成配置"><i  class="fa fa-plus"></i>新增</button>
      </div>
    </div>
    <div class="card-body pd-10">
      <#form:form id="searchForm" model="${genTable}" action="${ctx}/genTable/listData" method="post"  class="form-horizontal"
				data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
        <div class="form-group">
          <div class="input-group wd-250">
            <div class="input-group-prepend">
              <span class="input-group-text">表名称</span>
            </div>
            <#form:input path="tableName" class="form-control" />
          </div>
        </div>
        <div class="form-group">
          <button type="submit" class="btn btn-primary btn-sm">查询</button>
          <button type="reset" class="btn btn-default btn-sm">重置</button>
        </div>
      </#form:form>
      <table id="dataGrid"></table>
      <div id="dataGridPage"></div>
    </div>
  </div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [ 
		{header:'表名称', name:'tableName', index:'table_name', width:200, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/genTable/form?tableName='+row.tableName+'" class="btnList" data-title="编辑生成配置">'+val+'</a>';
		}},
		{header:'表说明', name:'comments', index:'comments', width:200},
		{header:'模块名称', name:'moduleName', sortable:false, classes:"nowrap"},
		{header:'创建时间', name:'createTime', index:'create_time'},
		{header:'功能作者', name:'functionAuthor', index:'function_author'},
		{header:'操作', name:'actions', width:100, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
				actions.push('<a href="${ctx}/genTable/form?tableName='+row.tableName+'" class="btnList" title="编辑生成配置"><i class="la la-edit"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/genTable/delete?tableName='+row.tableName+'" class="btnList" title="删除生成配置" data-confirm="确认要删除该参数吗？"><i class="la la-trash"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/genTable/form?tableName='+row.tableName+'&op=step3" class="btnList" title="生成代码"><i class="la la-bug"></i></a>&nbsp;');
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});

</script>
</body></html>